import { formatBigNumber } from "@/comm/format";
import { getTooltip } from "@/comm/tooltip";
import i18n from "@/locals";
/**公共的位置设置 */
const grid = {
    top: "3%",
    left: "10%",
    right: "5%",
    bottom: "10%"
};

export let hoverdate = {};
/**链上异动图表数据 */
const DataChangesOption: echarts.EChartOption = {
    grid: grid,
    title: {
        text: "链上异动"
    },
    tooltip: {
        trigger: "axis",
        axisPointer: {
            axis: "x",
            type: "line",
            lineStyle: {
                color: "#464C52"
            },
            label: {
                backgroundColor: "#283b56"
            }
        }
    },
    xAxis: {
        data: [
            "2017-10-24",
            "2017-10-25",
            "2017-10-26",
            "2017-10-27",
            "2017-10-24",
            "2017-10-25",
            "2017-10-26",
            "2017-10-27",
            "2017-10-24",
            "2017-10-25",
            "2017-10-26",
            "2017-10-27",
            "2017-10-24",
            "2017-10-25",
            "2017-10-26",
            "2017-10-27",
            "2017-10-24",
            "2017-10-25",
            "2017-10-26",
            "2017-10-27"
        ]
    },
    yAxis: {
        position: 'right',
        max: (value) => {
            return value.max

        },
        min: (value) => {
            return value.min
        },
        axisLabel: {
            formatter: (value: any) => {
                console.log('Y轴数据!!!!!!!!!!!!!!!!!!!!!', value)
            }
        },
        splitLine: {
            show: false
        }
    },
    series: [
        {
            type: "candlestick",
            data: [
                [20, 34, 10, 38],
                [40, 35, 30, 50],
                [31, 38, 33, 44],
                [38, 15, 5, 42],
                [20, 34, 10, 38],
                [40, 35, 30, 50],
                [31, 38, 33, 44],
                [38, 15, 5, 42],
                [20, 34, 10, 38],
                [40, 35, 30, 50],
                [31, 38, 33, 44],
                [38, 15, 5, 42],
                [20, 34, 10, 38],
                [40, 35, 30, 50],
                [31, 38, 33, 44],
                [38, 15, 5, 42]
            ]
        }
    ]
};
/**余额历史记录图表数据 */
const BalanceHistory: echarts.EChartOption = {
    grid: grid,
    tooltip: getTooltip(),
    xAxis: {
        type: "category",
        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
    },
    yAxis: {
        type: "value",
        splitLine: {
            lineStyle: {
                color: "#2E3345"
            }
        }
    },
    series: [
        {
            name: i18n.global.t("message.YTabCol_.tableC.a"),
            data: [150, 230, 224, 218, 135, 147, 260],
            type: "line",
            stack: "Total",
            areaStyle: {
                color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                        // 渐变颜色
                        {
                            offset: 0,
                            color: "rgba(252, 194, 53, 0.2)"
                        },
                        {
                            offset: 1,
                            color: "rgba(252, 194, 53, 0.01)"
                        }
                    ],
                    global: false
                }
            },
            itemStyle: {
                color: "#FCC235"
            }
        }
    ]
};

// /**余额历史记录图表数据 */
// const BalanceHistory = {
//     grid: grid,
//     title: {
//         text: "余额历史数据"
//     },
//     tooltip: {
//         trigger: 'axis',
//         formatter: function (params: any) {
//             params = params[0];
//             // console.log('yzt_tip', params);
//             return `${formatBigNumber(params.value)}`;
//         },
//         axisPointer: {
//             animation: false
//         }
//     },
//     xAxis: {
//         type: 'category',
//         data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
//     },
//     yAxis: {
//         type: 'value',
//         splitLine: {
//             show: false
//         }
//     },
//     series: [
//         {
//             data: [150, 230, 224, 218, 135, 147, 260],
//             type: 'line',
//             smooth: true
//         }
//     ]
// }

export { DataChangesOption, BalanceHistory };
